(module test-support mzscheme
  (require "../src/core.scm"
           (planet "test.ss" ("schematics" "schemeunit.plt" 2)))
  
  (provide cat-test cat-unit-test)
  
  ;; Macro for defining test cases
  ;; usage: (cat-test "description" (cat expressions) => (expected list))
  (define-syntax cat-test
    (syntax-rules (=>)
      ((_ description (cat ...) => (exp ...))
       (test-equal? description (cat-main cat ...) (list exp ...)))))
  
  ;; Expect the list containing just true (this corresponds to the unit tests in 
  ;; the spec)
  (define-syntax cat-unit-test
    (syntax-rules ()
      ((_ description code ...)
       (test-equal? (string-append description " unit test") (cat-main code ...) (list #t))))))
